import axios from "@/utils/axios";

export default {
    // 创建职员
    createStaff(staff) {
        return axios.post('/users/staffs', staff);
    },
    // 更新职员
    updateStaff(staff) {
        return axios.put('/users/staffs', staff);
    },
    // 获取职员列表
    getStaffs(agencyId, schoolIds, groupIds) {
        return axios.get('/users/getStaffs', {
            params: {
                agencyId: agencyId,
                schoolIds: schoolIds,
                groupIds: groupIds
            }
        });
    },
    // 设置手动添加花名册开关，正常情况下agency owner 和agency admin默认打开
    setRosterSwitch(opens) {
        return axios.post('/users/settings/userManualAddingRoster', opens);
    },
    // 设置Approval开关
    setApprovalSwitch(opens) {
        return axios.post('/users/settings/approval', opens);
    },
    // 设置通知权限开关
    setNotificationSwitch(opens) {
        return axios.post('/users/settings/notifications', opens);
    },
    // 设置通知权限开关
    setRatingSwitch(opens) {
        return axios.post('/users/settings/Rating', opens);
    },
    batchDeleteStaff(staffIds) {
        return axios.post('/users/staffs/batch/delete', staffIds);
    },
    // 删除员工
    deleteStaff(staffId) {
        return axios.delete('/users/staffs/' + staffId);
    },
    // 重置用戶密碼
    resetPassword(userId, password) {
        return axios.put('/users/' + userId + '/resetPassword', {password: password});
    },

    updateUserProfile(userInfo) {
        return axios.put('/users/userProfile', userInfo);
    },

    getUserProfile() {
        return axios.get('/users/userProfile');
    },

}
